package com.jy.api.domain;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;

/**
 * Created by hanxi on 2018/8/29.
 */
@Data
@NoArgsConstructor
@XStreamAlias("xml")
@ToString
public class SwiftPassQRCodePayResult {
    @XStreamAlias("version")
    private String version;

    @XStreamAlias("charset")
    private String charset;

    @XStreamAlias("sign_type")
    private String signType;

    @XStreamAlias("status")
    private String status;

    @XStreamAlias("message")
    private String message;

    @XStreamAlias("result_code")
    private String resultCode;

    @XStreamAlias("mch_id")
    private String mchId;

    @XStreamAlias("nonce_str")
    private String nonceStr;

    @XStreamAlias("err_code")
    private String errCode;

    @XStreamAlias("err_msg")
    private String errMsg;

    @XStreamAlias("sign")
    private String sign;

    @XStreamAlias("code_url")
    private String codeURL;
    @XStreamAlias("code_img_url")
    private String codeImgURL;

    public boolean isSuccess() {
        if (status.equals("0") && StringUtils.isNotEmpty(resultCode) && resultCode.equals("0")) {
            return true;
        } else {
            return false;
        }

    }
}
